#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>
#include<string.h>
int GetWordNum(char arr[])
{
	int count = 0,i = 0;
	int sz = strlen(arr);
	if (arr[0] != ' ')
	{
		while (*arr++ != '\0')
		{
			if (*arr == ' ' && *(arr + 1) != ' ')
				count++;
		}
		return count + 1;
	}
	else if (arr[0] == ' ')
	{
		for (i = 0; i < sz; i++)
		{
			if (arr[i] == ' ' && arr[i + 1] != ' ' && arr[i+1] !='\0')
				count++;
		}
		return count;
	}
}
int main()
{
	char arr[1000];
	gets(arr);
	printf("%d", GetWordNum(arr));
	return 0;
}